home *** CD-ROM | disk | FTP | other *** search
/ 64'er / 64ER_CD.iso / s85xx / s8505.d64 / print using (.txt) < prev    next >
Commodore BASIC  |  1995-03-30  |  5KB  |  72 lines

  1. 10 REM ************************************************************************
  2. 11 REM *                 F O R M A T R O U T I N E                            *
  3. 12 REM ************************************************************************
  4. 13 REM * COPYRIGHT:                                                           *
  5. 14 REM *  DR.M.IRSKENS                                                        *
  6. 15 REM *  LEVESER ALLEE 13                                                    *
  7. 16 REM *  3061 HESPE                                                          *
  8. 17 REM ************************************************************************
  9. 18 REM *                                                                      *
  10. 19 REM * AUFRUF:                                                              *
  11. 20 REM *  USR(X),FL,NK                                                        *
  12. 21 REM *    X  = ZU FORMATIERENDER NUMERISCHER WERT                           *
  13. 22 REM *    FL = FELDLAENGE DER FORMATIERTEN ZAHL                             *
  14. 23 REM *    NK = ANZAHL NACHKOMMASTELLEN DER FORMATIERTEN ZAHL                *
  15. 24 REM *  DAS ERGEBNIS DER USR-FUNKTION IST DER FORMATIERTE STRING. DIESER    *
  16. 25 REM *  KANN EINER STRINGVARIABLEN ZUGEWIESEN ODER AUSGEDRUCKT WERDEN.      *
  17. 26 REM * BEISPIELE:                                                           *
  18. 27 REM *  A$=(USR(XY),10,2)+""                                                *
  19. 28 REM *  PRINT USR(XY),10,2;" DM"                                            *
  20. 29 REM *                                                                      *
  21. 30 REM * BESONDERHEITEN:                                                      *
  22. 31 REM *  WENN NACHKOMMASTELLEN DURCH DAS FORMATIEREN ABGESCHNITTEN WERDEN,   *
  23. 32 REM *  SO WIRD DIE ZAHL GERUNDET.                                          *
  24. 33 REM *  ZAHLENDARSTELLUNGEN IM E-FORMAT WERDEN EBENFALLS VERARBEITET.       *
  25. 34 REM *  WENN DIE ZAHL IN DER ANGEGEBENEN FELDLAENGE NICHT DARGESTELLT       *
  26. 35 REM *  WERDEN KANN, DANN WIRD DIE ZAHL IN DER NOTWENDIGEN FELDLAENGE DAR-  *
  27. 36 REM *  GESTELLT, UM EINEN ZIFFERVERLUST ZU VERMEIDEN.                      *
  28. 37 REM *                                                                      *
  29. 38 REM * VOR AUFRUF DER FUNKTION MUESSEN FOLGENDE BEFEHLE EINMALIG DURCHGE-   *
  30. 39 REM * FUEHRT WERDEN:                                                       *
  31. 40 REM *   POKE 785,0   : LOW-BYTE DER STARTADRESSE                           *
  32. 41 REM *   POKE 786,192 : HIGH-BYTE DER STARTADRESSE = 49152                  *
  33. 42 REM *                                                                      *
  34. 43 REM * DIE ROUTINE IST VOLL VERSCHIEBLICH UND KANN DAHER AN JEDER STELLE IM *
  35. 44 REM * SPEICHER LIEGEN. DIE ADRESSEN DER USR-FUNKTION SIND DANN ENTSPRECHEND*
  36. 45 REM * ANZUPASSEN.                                                          *
  37. 46 REM *                                                                      *
  38. 47 REM ************************************************************************
  39. 100 S=0:INPUT "STARTADRESSE";B
  40. 110 FOR I=B TO B+335
  41. 120 READ A
  42. 130 S=S+A:POKE I,A
  43. 140 NEXT I
  44. 150 IF S<>36986 THEN PRINT " FEHLER IN DEN DATAZEILEN [146]":STOP
  45. 160 POKE 785,B-256*INT(B/256):POKE 786,B/256
  46. 170 PRINT " ALLES OK. "
  47. 199 REM TESTBEISPIELE
  48. 200 FOR E=0 TO 9
  49. 210 F=(null)*10^E
  50. 220 A$=(USR(F),11,0)+""
  51. 230 PRINT A$;USR(F),13,1;USR(F),14,2
  52. 240 NEXT E
  53. 250 END
  54. 299 REM DATAZEILEN
  55. 300 DATA32,141,173,32,221,189,32,253,174,32,158,183,134,88,32,253,174,32
  56. 301 DATA158,183,134,87,104,104,162,255,160,0,232,189,0,1,240,117,201,69,240
  57. 302 DATA8,201,46,208,242,138,168,208,238,173,2,1,201,46,208,12,202,160,1
  58. 303 DATA200,185,1,1,153,0,1,208,247,189,2,1,41,15,10,133,2,10,10,101,2,125
  59. 304 DATA3,1,233,47,188,1,1,192,45,240,23,105,3,134,2,229,2,168,169,48,157
  60. 305 DATA0,1,232,136,208,249,169,0,157,0,1,240,168,133,2,169,0,157,0,1,138
  61. 306 DATA24,101,2,168,189,0,1,240,8,201,48,176,4,169,48,208,1,202,153,0,1
  62. 307 DATA136,208,236,169,46,141,1,1,208,129,152,240,18,165,87,208,7,152,170
  63. 308 DATA189,1,1,208,119,169,44,153,0,1,208,12,196,87,240,40,169,44,157,0
  64. 309 DATA1,232,208,16,132,2,56,138,229,2,56,233,1,197,87,240,19,176,72,168
  65. 310 DATA169,48,157,0,1,232,200,196,87,208,247,169,0,157,0,1,173,1,1,201,48
  66. 311 DATA176,17,232,138,168,185,255,0,153,0,1,136,208,247,169,48,141,1,1,228
  67. 312 DATA88,176,20,164,88,189,0,1,153,0,1,136,202,16,246,169,32,153,0,1,136
  68. 313 DATA16,250,169,0,160,1,76,135,180,56,229,87,133,2,138,56,229,2,170,189
  69. 314 DATA0,1,201,53,144,179,138,168,136,240,24,185,0,1,201,48,144,246,24,105
  70. 315 DATA1,201,58,153,0,1,208,157,169,48,153,0,1,208,229,138,168,185,0,1,153
  71. 316 DATA1,1,136,208,247,169,49,141,1,1,232,208,131
  72.